{% extends '_base.html' %}
{% block head %}
    {{ super() }}
    <!-- 图表库Echarts及其主题 -->
    <!-- <script src="https://cdn.staticfile.org/echarts/5.5.0/echarts.min.js"></script> -->
{% endblock head %}
{% block active_data %} btn-primary {% endblock %}


{% block content %}

<!-- 1 顶栏 -->
<nav class="navbar navbar-expand navbar-light bg-light">
    <div class="collapse navbar-collapse" id="navbarNavAltMarkup">
        <div class="navbar-nav">
            <a class="nav-item nav-link {% if type==2 %}active actmore{% endif %}" href="{{ url_for('data.day_detail', type=2) }}">细节</a>
            <a class="nav-item nav-link {% if type==0 %}active actmore{% endif %}" href="{{ url_for('data.data', type=0, month=month, year=year) }}">堆叠</a>
            <a class="nav-item nav-link {% if type==1 %}active actmore{% endif %}" href="{{ url_for('data.data', type=1, month=month, year=year) }}">日况</a>

            <!-- 下拉列表链接用的.data端点，但星图是.graph端点 -->
            {% if type!=2 %}
            <!-- a 下拉-月份选择 -->
            <li class="nav-item dropdown">
                {% set months = [1,2,3,4,5,6,7,8,9,10,11,12] %}
            
                <a class="nav-link dropdown-toggle" role="button" href="#" id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true"
                    aria-expanded="false">
                    {{ month }}月
                </a>
                <div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
                    {% for m in months %}
                    <a class="dropdown-item" href="{{ url_for('data.data', type=type, month=m, year=year) }}">
                        {{ m }}
                    </a>
                    {% endfor %}
                </div>
            </li>

            <!-- b 下拉-年份选择 -->
            <li class="nav-item dropdown">
                <!-- 备注：最好调整到截至当前年 -->
                {% set years = [2023, 2024, 2025] %} 
            
                <a class="nav-link dropdown-toggle" role="button" href="#" id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true"
                    aria-expanded="false">
                    {{ year }}年
                </a>
                <div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
                    {% for y in years %}
                    <a class="dropdown-item" href="{{ url_for('data.data', type=type, month=month, year=y) }}">
                        {{ y }}
                    </a>
                    {% endfor %}
                </div>
            </li>
            {% else %}
            
            {% endif %}
            {% block top_bar %}{% endblock top_bar %}
        </div>
    </div>
    {% block top_bar_nav %}{% endblock top_bar_nav %}
</nav>

<!-- 2 展示页面 -->
{% block show %}
    <!-- 为ECharts准备一个具备大小（宽高）的Dom -->
    <div id="main" style="width: 1080;height:640px;" class="container-fluid"></div>
{% endblock %}

{% endblock %}